From 5a9508ef46c06a8dcadd0e34b621d698f612cb97 Mon Sep 17 00:00:00 2001 From: "tsteven4@gmail.com" Date: Tue, 7 Jan 2014 23:32:31 +0000 Subject: [PATCH] correct bug introduced to an1 reader wrt url strings. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4718 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/an1.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gpsbabel/an1.cc b/gpsbabel/an1.cc index 2ef6b42f4..80bc8e128 100644 --- a/gpsbabel/an1.cc +++ b/gpsbabel/an1.cc @@ -713,9 +713,13 @@ static void Read_AN1_Waypoints(gbfile* f) wpt_tmp->AddUrlLink(rec->url); } else { int u = wpt_tmp->description.indexOf("{URL="); - QString us = wpt_tmp->description.mid(u); - if (!us.isEmpty()) { - wpt_tmp->AddUrlLink(us); + if (u != -1) { + QString us = wpt_tmp->description.mid(u); + us.remove(0,5); // throw away anything up to and including "{URL=" + us.chop(1); // throw away final character, assumed to be "}" + if (!us.isEmpty()) { + wpt_tmp->AddUrlLink(us); + } } } -- 2.30.2